////
////  MFWUserLoginManager.m
////  MFWSdk
////
////  Created by Song Xiaofeng on 13-8-6.
////  Copyright (c) 2013年 Mafengwo Inc. All rights reserved.
////
//
//#import "MFWShareManager.h"
//#import <ShareSDK/ShareSDK.h>
////#import "MFWSDKNotificationConsts.h"
//#import "WXApi.h"
//#import <TencentOpenAPI/QQApi.h>
//#import <TencentOpenAPI/QQApiInterface.h>
//#import <TencentOpenAPI/TencentOAuth.h>
//#import "UIView+MFWShare_ShowTip.h"
//
//
//
//@interface MFWShareManager()
//
//
//
///**
// *	根据MFWShareType转化为ShareSDK的ShareType
// *
// *	@param	mfwShareType	MFWShareType
// *
// *	@return	ShareSDK的ShareType
// */
//-(ShareType)getShareSDKShareType:(MFWShareType)mfwShareType;
//
///**
// *	根据ShareSDK的ShareType转化为MFWShareType
// *
// *	@param	shareType	ShareSDK的ShareType
// *
// *	@return	MFWShareType
// */
//-(MFWShareType)getMFWShareType:(ShareType)shareType;
//
//
//@property (nonatomic,strong) NSString* ssSinaAppKey;
//@property (nonatomic,strong) NSString* ssQQAppID;
//@property (nonatomic,strong) NSString* ssWXAppID;
//@property (nonatomic,strong) NSString* ssQQSpaceAppKey;
//@property (nonatomic,strong) NSString* ssRenrenAppId;
//
//@property (nonatomic,copy) void(^blockViewContrllorWillShow)(UIViewController* viewController);
//
//@end
//
//@implementation MFWShareManager
//
//-(ShareType)getShareSDKShareType:(MFWShareType)mfwShareType
//{
//    NSInteger num = mfwShareType;
//    ShareType shareType = num;
//    return shareType;
//}
//-(MFWShareType)getMFWShareType:(ShareType)shareType
//{
//    NSInteger num = shareType;
//    MFWShareType mfwShareType = num;
//    return mfwShareType;
//}
//
//-(void)checkUrlSchemeConfig
//{
//    NSArray* array = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleURLTypes"];
//    
//    
//    NSString* ssSinaAppKey = [MFWShareManager sharedInstance].ssSinaAppKey;
//    NSString* ssQQAppID = [MFWShareManager sharedInstance].ssQQAppID;
//    NSString* ssWXAppID = [MFWShareManager sharedInstance].ssWXAppID;
//    NSString* ssQQSpaceAppKey = [MFWShareManager sharedInstance].ssQQSpaceAppKey;
//    NSString* ssRenRenAppId = [MFWShareManager sharedInstance].ssRenrenAppId;
//    
//    
//    BOOL sinaWeiboFailed = ssSinaAppKey.length > 0;
//    BOOL qqFailed = ssQQAppID.length > 0;
//    BOOL wxFailed = ssWXAppID.length > 0;
//    BOOL qqSpaceFailed = ssQQSpaceAppKey.length > 0;
//    BOOL renrenFailed = ssRenRenAppId.length > 0;
//    
//    
//    for (NSDictionary* dic in array) {
//        NSArray* shemes = [dic objectForKey:@"CFBundleURLSchemes"];
//        for (NSString* urlScheme in shemes) {
//            NSString* str = nil;
//            
//            str = [NSString stringWithFormat:@"sinaweibosso.%@",ssSinaAppKey];
//            if ([str isEqualToString:urlScheme]) {
//                sinaWeiboFailed = NO;
//            }
//            if ([ssQQAppID isEqualToString:urlScheme]) {
//                qqFailed = NO;
//            }
//            if ([ssWXAppID isEqualToString:urlScheme]) {
//                wxFailed = NO;
//            }
//            
//            // 校验QQ空间
//            str = [NSString stringWithFormat:@"tencent%@",ssQQSpaceAppKey];
//            if ([str isEqualToString:urlScheme]) {
//                qqSpaceFailed = NO;
//            }
//            
//            // 校验人人
//            str = [NSString stringWithFormat:@"rm%@%@",ssRenRenAppId,[NSBundle mainBundle].bundleIdentifier];
//            if ([str isEqualToString:urlScheme]) {
//                renrenFailed = NO;
//            }
//            
//        }
//    }
//    
//    // 校验 新浪微博
//    NSAssert(!sinaWeiboFailed, @"[MFWShare]UrlScheme未配置：新浪微博[%@]",[NSString stringWithFormat:@"sinaweibosso.%@",ssSinaAppKey]);
//    
//    // 校验 QQ
//    NSAssert(!qqFailed, @"[MFWShare]UrlScheme未配置：QQ[%@]",ssQQAppID);
//    
//    // 校验 微信
//    NSAssert(!wxFailed, @"[MFWShare]UrlScheme未配置：微信[%@]",ssWXAppID);
//    
//    // 校验 QQ空间
//    NSAssert(!qqSpaceFailed, @"[MFWShare]UrlScheme未配置：QQ空间[%@]",ssQQSpaceAppKey);
//    
//    // 校验 人人
//    NSAssert(!renrenFailed, @"[MFWShare]UrlScheme未配置：人人[%@]",ssRenRenAppId);
//    
//}
//
//
//- (void)registerAppWithKeyOfShareSDK:(NSString *)appKey
//{
//    [ShareSDK registerApp:appKey];
//    
//    [self checkUrlSchemeConfig];
//    
//    [ShareSDK ssoEnabled:YES];
//}
//
//- (BOOL)handleOpenURL:(NSURL *)url
//    sourceApplication:(NSString *)sourceApplication
//           annotation:(id)annotation
//           wxDelegate:(id)wxDelegate
//{
//    return [ShareSDK handleOpenURL:url sourceApplication:sourceApplication annotation:annotation wxDelegate:wxDelegate];
//}
//
//
//#pragma mark UI调整
//- (void)setBlockViewControllerWillShow:(void(^)(UIViewController* viewController))blockViewControllerWillShow
//{
//    _blockViewContrllorWillShow = blockViewControllerWillShow;
//}
//
//+ (MFWShareManager *)sharedInstance;
//{
//    static MFWShareManager *_sharedInstance = nil;
//	if (_sharedInstance == nil)
//	{
//        static dispatch_once_t onceToken;
//        dispatch_once(&onceToken, ^{
//            _sharedInstance = [[MFWShareManager alloc] init];
//			
//        });
//	}
//	
//	return _sharedInstance;
//}
//
//@synthesize disableDefaultShareResultTips;
//
//-(NSMutableArray*)arrayShareType
//{
//    if(!_arrayShareType)
//    {
//        _arrayShareType = [[NSMutableArray alloc] initWithCapacity:0];
//    }
//    
//    return _arrayShareType;
//}
//-(NSMutableDictionary*)dictAppId
//{
//    if(!_dictAppId)
//    {
//        _dictAppId = [[NSMutableDictionary alloc] initWithCapacity:0];
//    }
//    
//    return _dictAppId;
//}
//-(NSMutableDictionary*)dictAppKey
//{
//    if(!_dictAppKey)
//    {
//        _dictAppKey = [[NSMutableDictionary alloc] initWithCapacity:0];
//    }
//    
//    return _dictAppKey;
//}
//-(NSMutableDictionary*)dictAppSecret
//{
//    if (!_dictAppSecret) {
//        _dictAppSecret = [[NSMutableDictionary alloc] initWithCapacity:0];
//    }
//    
//    return _dictAppSecret;
//}
//
//// 校验第三方平台是否配置
//-(BOOL)hasSet:(MFWShareType)type
//{
//    __block BOOL hasSet = NO;
//    
//    NSNumber* shareTypeNumber = [NSNumber numberWithInteger:type];
//    [self.arrayShareType enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
//        if ([obj isKindOfClass:[NSNumber class]]) {
//            NSNumber* number = obj;
//            if ([number isEqualToValue:shareTypeNumber]) {
//                hasSet = YES;
//            }
//        }
//    }];
//    
//    return hasSet;
//}
//
//
//
//#pragma mark 获取已连接的第三方平台
///**
// *	已连接的第三方平台
// */
//- (NSArray*)getConnectedShareTypeArray
//{
//    return [self.arrayShareType copy];
//}
//
///**
// *	获取第三方平台的id
// *
// *	@param	type	第三方平台
// */
//- (NSString*)getAppIdWithType:(MFWShareType)type
//{
//    return self.dictAppId[[NSNumber numberWithInteger:type]];
//}
///**
// *	获取第三方平台的key
// *
// *	@param	type	第三方平台
// */
//- (NSString*)getAppKeyWithType:(MFWShareType)type
//{
//    return self.dictAppKey[[NSNumber numberWithInteger:type]];
//}
///**
// *	获取第三方平台的secret
// *
// *	@param	type	第三方平台
// */
//- (NSString*)getAppSecretWithType:(MFWShareType)type
//{
//    return self.dictAppSecret[[NSNumber numberWithInteger:type]];
//}
//
//
//#pragma mark 初始化
//
//
///**
// *	开启Email分享
// */
//- (void)connectMail
//{
//    MFWShareType shareType = MFWShareTypeMail;
//    if (![self hasSet:shareType]) {
//        [self.arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
//        [ShareSDK connectMail];
//    }
//}
//
///**
// *	开启短信分享
// */
//- (void)connectSMS
//{
//    MFWShareType shareType = MFWShareTypeSMS;
//    if (![self hasSet:shareType]) {
//        [self.arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
//        [ShareSDK connectSMS];
//    }
//}
//
///**
// *	开启拷贝
// */
//- (void)connectCopy
//{
//    MFWShareType shareType = MFWShareTypeCopy;
//    if (![self hasSet:shareType]) {
//        [self.arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
//        [ShareSDK connectCopy];
//    }
//}
//
///**
// *	@brief	连接新浪微博开放平台应用以使用相关功能，此应用需要引用SinaWeiboConnection.framework
// *          http://open.weibo.com上注册新浪微博开放平台应用，并将相关信息填写到以下字段
// *
// *	@param 	appKey 	应用Key
// *	@param 	appSecret 	应用密钥
// *	@param 	redirectUri 	回调地址,无回调页面或者不需要返回回调时可以填写新浪默认回调页面：https://api.weibo.com/oauth2/default.html
// *                          但新浪开放平台中应用的回调地址必须填写此值
// */
//- (void)connectSinaWeiboWithAppKey:(NSString *)appKey
//                         appSecret:(NSString *)appSecret
//                       redirectUri:(NSString *)redirectUri
//{
//    [ShareSDK connectSinaWeiboWithAppKey:appKey appSecret:appSecret redirectUri:redirectUri];
//    
//    MFWShareType shareType = MFWShareTypeSinaWeibo;
//    if (![self hasSet:shareType]) {
//        [self.arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
//    }
//    
//    self.ssSinaAppKey = appKey;
//    NSNumber* numberShareType = [NSNumber numberWithInteger:shareType];
//    self.dictAppKey[numberShareType] = appKey;
//    self.dictAppSecret[numberShareType] = appSecret;
//    
//    [self checkUrlSchemeConfig];
//}
//
///**
// *	@brief	连接腾讯微博开放平台应用以使用相关功能，此应用需要引用TencentWeiboConnection.framework
// *          http://dev.t.qq.com上注册腾讯微博开放平台应用，并将相关信息填写到以下字段
// *
// *	@param 	appKey 	应用Key
// *	@param 	appSecret 	应用密钥
// *	@param 	redirectUri 	回调地址，此地址则为应用地址。
// */
//- (void)connectTencentWeiboWithAppKey:(NSString *)appKey
//                            appSecret:(NSString *)appSecret
//                          redirectUri:(NSString *)redirectUri
//{
//    [ShareSDK connectTencentWeiboWithAppKey:appKey appSecret:appSecret redirectUri:redirectUri wbApiCls:[WXApi class]];
//    
//    MFWShareType shareType = MFWShareTypeTencentWeibo;
//    if (![self hasSet:shareType]) {
//        [self.arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
//    }
//    
//    NSNumber* numberShareType = [NSNumber numberWithInteger:shareType];
//    self.dictAppKey[numberShareType] = appKey;
//    self.dictAppSecret[numberShareType] = appSecret;
//}
//
///**
// *	@brief	连接QQ空间应用以使用相关功能，此应用需要引用QZoneConnection.framework
// *          http://connect.qq.com/intro/login/上申请加入QQ登录，并将相关信息填写到以下字段
// *
// *	@param 	appKey 	应用Key
// *	@param 	appSecret 	应用密钥
// */
//- (void)connectQZoneWithAppKey:(NSString *)appKey
//                     appSecret:(NSString *)appSecret
//{
//    [ShareSDK connectQZoneWithAppKey:appKey appSecret:appSecret qqApiInterfaceCls:[QQApiInterface class]
//                     tencentOAuthCls:[TencentOAuth class]];
//    
//    MFWShareType shareType = MFWShareTypeQQSpace;
//    if (![self hasSet:shareType]) {
//        [self.arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
//    }
//    
//    self.ssQQSpaceAppKey = appKey;
//    NSNumber* numberShareType = [NSNumber numberWithInteger:shareType];
//    self.dictAppKey[numberShareType] = appKey;
//    self.dictAppSecret[numberShareType] = appSecret;
//    
//    [self checkUrlSchemeConfig];
//}
//
//
///**
// *	@brief	连接网易微博应用以使用相关功能，此应用需要引用T163WeiboConnection.framework
// *          http://open.t.163.com上注册网易微博开放平台应用，并将相关信息填写到以下字段
// *
// *	@param 	appKey 	应用Key
// *	@param 	appSecret 	应用密钥
// *	@param 	redirectUri 	回调地址
// */
//- (void)connect163WeiboWithAppKey:(NSString *)appKey
//                        appSecret:(NSString *)appSecret
//                      redirectUri:(NSString *)redirectUri
//{
//    [ShareSDK connect163WeiboWithAppKey:appKey appSecret:appSecret redirectUri:redirectUri];
//    
//    MFWShareType shareType = MFWShareType163Weibo;
//    if (![self hasSet:shareType]) {
//        [self.arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
//    }
//    
//    NSNumber* numberShareType = [NSNumber numberWithInteger:shareType];
//    self.dictAppKey[numberShareType] = appKey;
//    self.dictAppSecret[numberShareType] = appSecret;
//}
//
///**
// *	@brief	连接搜狐微博应用以使用相关功能，此应用需要引用SohuWeiboConnection.framework
// *          http://open.t.sohu.com上注册搜狐微博开放平台应用，并将相关信息填写到以下字段
// *
// *	@param 	consumerKey 	消费者Key
// *	@param 	consumerSecret 	消费者密钥
// *  @param  redirectUri     回调地址
// */
//- (void)connectSohuWeiboWithConsumerKey:(NSString *)consumerKey
//                         consumerSecret:(NSString *)consumerSecret
//                            redirectUri:(NSString *)redirectUri
//{
//    [ShareSDK connectSohuWeiboWithConsumerKey:consumerKey consumerSecret:consumerKey redirectUri:redirectUri];
//    
//    MFWShareType shareType = MFWShareType163Weibo;
//    if (![self hasSet:shareType]) {
//        [self.arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
//    }
//    
//    NSNumber* numberShareType = [NSNumber numberWithInteger:shareType];
//    self.dictAppKey[numberShareType] = consumerKey;
//    self.dictAppSecret[numberShareType] = consumerSecret;
//}
//
///**
// *	@brief	连接豆瓣应用以使用相关功能，此应用需要引用DouBanConnection.framework
// *          http://developers.douban.com上注册豆瓣社区应用，并将相关信息填写到以下字段
// *
// *	@param 	appKey 	应用Key
// *	@param 	appSecret 	应用密钥
// *	@param 	redirectUri 	回调地址
// */
//- (void)connectDoubanWithAppKey:(NSString *)appKey
//                      appSecret:(NSString *)appSecret
//                    redirectUri:(NSString *)redirectUri
//{
//    [ShareSDK connectDoubanWithAppKey:appKey appSecret:appSecret redirectUri:redirectUri];
//    
//    MFWShareType shareType = MFWShareTypeDouBan;
//    if (![self hasSet:shareType]) {
//        [self.arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
//    }
//    
//    NSNumber* numberShareType = [NSNumber numberWithInteger:shareType];
//    self.dictAppKey[numberShareType] = appKey;
//    self.dictAppSecret[numberShareType] = appSecret;
//}
//
///**
// *	@brief	连接人人网应用以使用相关功能，此应用需要引用RenRenConnection.framework
// *          http://dev.renren.com上注册人人网开放平台应用，并将相关信息填写到以下字段
// *
// *  @param  appId   应用ID
// *	@param 	appKey 	应用Key
// *	@param 	appSecret 	应用密钥
// */
//- (void)connectRenRenWithAppId:(NSString *)appId
//                        appKey:(NSString *)appKey
//                     appSecret:(NSString *)appSecret
//{
//    [ShareSDK connectRenRenWithAppId:appId appKey:appKey appSecret:appSecret renrenClientClass:nil];
//    
//    MFWShareType shareType = MFWShareTypeRenren;
//    if (![self hasSet:shareType]) {
//        [self.arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
//    }
//    
//    self.ssRenrenAppId = appId;
//    NSNumber* numberShareType = [NSNumber numberWithInteger:shareType];
//    self.dictAppId[numberShareType] = appId;
//    self.dictAppKey[numberShareType] = appKey;
//    self.dictAppSecret[numberShareType] = appSecret;
//    
//    [self checkUrlSchemeConfig];
//}
///**
// *	@brief	连接开心网应用以使用相关功能，此应用需要引用KaiXinConnection.framework
// *          http://open.kaixin001.com上注册开心网开放平台应用，并将相关信息填写到以下字段
// *
// *	@param 	appKey 	应用Key
// *	@param 	appSecret 	应用密钥
// *	@param 	redirectUri 	回调地址
// */
//- (void)connectKaiXinWithAppKey:(NSString *)appKey
//                      appSecret:(NSString *)appSecret
//                    redirectUri:(NSString *)redirectUri
//{
//    [ShareSDK connectKaiXinWithAppKey:appKey appSecret:appSecret redirectUri:redirectUri];
//    
//    MFWShareType shareType = MFWShareTypeKaixin;
//    if (![self hasSet:shareType]) {
//        [self.arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
//    }
//    
//    NSNumber* numberShareType = [NSNumber numberWithInteger:shareType];
//    self.dictAppKey[numberShareType] = appKey;
//    self.dictAppSecret[numberShareType] = appSecret;
//}
//
/////**
//// *	@brief	连接QQ应用以使用相关功能，此应用需要引用QQConnection.framework和QQApi.framework库
//// *          http://mobile.qq.com/api/上注册应用，并将相关信息填写到以下字段
//// *
//// *	@param 	appId 	应用ID
//// *	@param 	qqApiCls 	QQApi类型,引入QQApi.h后，将[QQApi class]传入此参数
//// */
////+ (void)connectQQWithAppId:(NSString *)appId
////                  qqApiCls:(Class)qqApiCls
////{
////    [ShareSDK connectQQWithAppId:appId qqApiCls:[QQApi class]];
////
////    // todo 校验url scheme
////    MFWShareType shareType = ShareTypeQQ;
////    if (![[self sharedInstance] hasSet:shareType]) {
////        [[self sharedInstance].arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
////    }
////}
//
///**
// *	@brief	连接QQ应用以使用相关功能，此应用需要引用QQConnection.framework和TencentOAuthAPI.framework库
// *          http://connect.qq.com上注册应用，并将相关信息填写到以下字段,
// *          可以调用此接口来使QQ空间中申请的AppKey用于QQ好友分享
// *
// *  @since  ver2.2.4
// *
// *	@param 	qzoneAppKey 	QQ空间App标识
// *	@param 	qqApiInterfaceCls 	QQAPI接口类型
// *	@param 	tencentOAuthCls 	腾讯OAuth类型
// */
//- (void)connectQQWithQZoneAppKey:(NSString *)qzoneAppKey
//{
//    @try {
//        [ShareSDK connectQQWithQZoneAppKey:qzoneAppKey qqApiInterfaceCls:[QQApi class] tencentOAuthCls:[TencentOAuth class]];
//        
//        MFWShareType shareType = MFWShareTypeQQ;
//        if (![self hasSet:shareType]) {
//            [self.arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
//        }
//        
//        // 这个比较特别，用的是qq空间的key，所以QQ的key不记在 dictAppKey中，如何处理，待定 todo
//    }
//    @catch (NSException *exception) {
//        NSLog(@"异常：connectQQWithQZoneAppKey：%@",exception);
//    }
//}
//
//
///**
// *	@brief	连接微信应用以使用相关功能，此应用需要引用WeChatConnection.framework和微信官方SDK
// *          http://open.weixin.qq.com上注册应用，并将相关信息填写以下字段
// *
// *	@param 	appId 	应用ID
// */
//- (void)connectWeChatWithAppId:(NSString *)appId
//{
//    [ShareSDK connectWeChatWithAppId:appId wechatCls:[WXApi class]];
//    
//    MFWShareType shareType = MFWShareTypeWeixiSession;
//    if (![self hasSet:shareType]) {
//        [self.arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
//    }
//    
//    shareType = MFWShareTypeWeixiTimeline;
//    if (![self hasSet:shareType]) {
//        [self.arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
//    }
//    
//    self.ssWXAppID = appId;
//    NSNumber* numberShareType = [NSNumber numberWithInteger:shareType];
//    self.dictAppId[numberShareType] = appId;
//    
//    [self checkUrlSchemeConfig];
//}
//
//- (void)connectEvernoteCNWithConsumerKey:(NSString *)consumerKey
//                          consumerSecret:(NSString *)consumerSecret
//{
//    SSEverNoteType noteType = SSEverNoteTypeCN;
//
////#ifdef DEBUG
////    noteType = SSEverNoteTypeSandbox;
////#endif
//    
//    [ShareSDK connectEvernoteWithType:noteType consumerKey:consumerKey consumerSecret:consumerSecret];
//    MFWShareType shareType = MFWShareTypeEvernote;
//    if(![self hasSet:shareType]){
//        [self.arrayShareType addObject:[NSNumber numberWithInteger:shareType]];
//    }
//    
//    NSNumber* numberShareType = [NSNumber numberWithInteger:shareType];
//    self.dictAppKey[numberShareType] = consumerKey;
//    self.dictAppSecret[numberShareType] = consumerSecret;
//}
//
//
///**
// *	@brief	分享内容iPhone
// *
// *	@param 	text    内容对象
// *	@param 	image   图片
// *  @param  url     链接
// *	@param 	title   标题
// *	@param 	result 	返回事件
// */
//- (void)shareText:(NSString*)text
//            image:(UIImage*)image
//              url:(NSString*)url
//            title:(NSString*)title
//           result:(void(^)(MFWShareType type,MFWShareResultState state, NSString* errorMsg))result
//{
//    [self shareText:text image:image url:url title:title controller:nil result:result];
//}
//
//- (void)shareText:(NSString*)text
//            image:(UIImage*)image
//              url:(NSString*)url
//            title:(NSString*)title
//       controller:(UIViewController*)controller
//           result:(void(^)(MFWShareType type,MFWShareResultState state, NSString* errorMsg))result
//{
//    [self shareText:text image:image imageUrl:nil url:url title:title controller:controller result:result];
//}
//
//
//- (void)shareText:(NSString*)text
//            image:(UIImage*)image
//         imageUrl:(NSString*)imageUrl
//              url:(NSString*)url
//            title:(NSString*)title
//       controller:(UIViewController*)controller
//           result:(void(^)(MFWShareType type,MFWShareResultState state, NSString* errorMsg))result
//{
//    id<ISSContainer> container = [ShareSDK container];
//    if (controller) {
//        [container setIPhoneContainerWithViewController:controller];
//    }
//
//    [self showShareActionSheet:container text:text image:image imageUrl:imageUrl url:url title:title result:result];
//}
//
//- (void)showShareActionSheet:(id<ISSContainer>)container
//                        text:(NSString*)text
//                       image:(UIImage*)image
//                    imageUrl:(NSString*)imageUrl
//                         url:(NSString*)url
//                       title:(NSString*)title
//                      result:(void(^)(MFWShareType type,MFWShareResultState state, NSString* errorMsg))result
//{
//    NSArray* shareList = self.arrayShareType;
//    
//    id<ISSContent> publishContent = [self shareSDKPublishContent:text image:image imageUrl:imageUrl url:url title:title];
//    id<ISSAuthOptions> authOptions = [self shareSDKAuthOption];
//    id<ISSShareOptions> shareOptions = [self shareSDKShareOption];
//    
//    [ShareSDK showShareActionSheet:container
//                         shareList:shareList
//                           content:publishContent
//                     statusBarTips:NO
//                       authOptions:authOptions
//                      shareOptions:shareOptions
//                            result:^(ShareType type, SSResponseState state, id<ISSPlatformShareInfo> statusInfo, id<ICMErrorInfo> error, BOOL end) {
//                                // 开始分享这个事件不处理
//                                if (!end) {
//                                    return;
//                                }
//                                
//                                MFWShareResultState mfwState = MFWShareResultStateFail;
//                                switch (state) {
//                                    case SSPublishContentStateSuccess:
//                                        mfwState = MFWShareResultStateSuccess;
//                                        break;
//                                    case SSPublishContentStateCancel:
//                                        mfwState = MFWShareResultStateCancel;
//                                        break;
//                                    case SSPublishContentStateFail:
//                                        mfwState = MFWShareResultStateFail;
//                                        break;
//                                    default:
//                                        return; // 不处理，直接返回
//                                        break;
//                                }
//                                
//                                NSString* errorMsg = [error errorDescription];
//                                if (result) {
//                                    result([self getMFWShareType:type],mfwState,errorMsg);
//                                }
//                                
//                                if (self.disableDefaultShareResultTips == NO) {
//                                    if(state == SSResponseStateSuccess){
//                                        UIWindow *window =  [UIApplication sharedApplication].keyWindow;
//                                        [window mfwshare_showTip:@"分享成功~😊"];
//                                    }
//                                    
//                                    if(state == SSResponseStateFail){
//                                        UIWindow *window =  [UIApplication sharedApplication].keyWindow;
//                                        NSString *failMsg = [NSString stringWithFormat:@"分享失败~😢,错误代码是%d",[error errorCode]];
//                                        [window mfwshare_showTip:failMsg];
//                                        
//                                    }
//                                }
//                            }];
//}
//
//
//
//
//
//
//
//- (void)iPadShareWithBarButton:(UIBarButtonItem*)barButtonItem
//                   arrowDirect:(MFWSharePopoverArrowDirection)arrowDirect
//                     shareText:(NSString*)text
//                         image:(UIImage*)image
//                      imageUrl:(NSString*)imageUrl
//                           url:(NSString*)url
//                         title:(NSString*)title
//                        result:(void(^)(MFWShareType type,MFWShareResultState state, NSString* errorMsg))result;
//{
//    id<ISSContainer> container = [ShareSDK container];
//    [container setIPadContainerWithBarButtonItem:barButtonItem arrowDirect:(UIPopoverArrowDirection)arrowDirect];
//    
//    [self showShareActionSheet:container text:text image:image imageUrl:imageUrl url:url title:title result:result];
//}
//
//- (void)iPadShareWithView:(UIView*)view
//              arrowDirect:(MFWSharePopoverArrowDirection)arrowDirect
//                shareText:(NSString*)text
//                    image:(UIImage*)image
//                 imageUrl:(NSString*)imageUrl
//                      url:(NSString*)url
//                    title:(NSString*)title
//                   result:(void(^)(MFWShareType type,MFWShareResultState state, NSString* errorMsg))result;
//{
//    id<ISSContainer> container = [ShareSDK container];
//    [container setIPadContainerWithView:view arrowDirect:(UIPopoverArrowDirection)arrowDirect];
//    [self showShareActionSheet:container text:text image:image imageUrl:imageUrl url:url title:title result:result];
//}
//
//
//-(void)shareWithType:(MFWShareType)type
//                text:(NSString *)text
//               image:(UIImage *)image
//            imageUrl:(NSString *)imageUrl
//                 url:(NSString *)url
//               title:(NSString *)title
//              result:(void (^)(MFWShareType, MFWShareResultState, NSString *))result
//{
//    id<ISSContent> publishContent = [self shareSDKPublishContent:text image:image imageUrl:imageUrl url:url title:title];
//    id<ISSAuthOptions> authOptions = [self shareSDKAuthOption];
//    id<ISSShareOptions> shareOptions = [self shareSDKShareOption];
//    id<ISSContainer> container = [ShareSDK container];
//    [container setIPhoneContainerWithViewController:nil];
//    
//    [ShareSDK showShareViewWithType:[self getShareSDKShareType:type] container:container content:publishContent statusBarTips:NO authOptions:authOptions shareOptions:shareOptions result:^(ShareType type, SSResponseState state, id<ISSPlatformShareInfo> statusInfo, id<ICMErrorInfo> error, BOOL end) {
//        // 开始分享这个事件不处理
//        if (!end) {
//            return;
//        }
//        
//        MFWShareResultState mfwState = MFWShareResultStateFail;
//        switch (state) {
//            case SSPublishContentStateSuccess:
//                mfwState = MFWShareResultStateSuccess;
//                break;
//            case SSPublishContentStateCancel:
//                mfwState = MFWShareResultStateCancel;
//                break;
//            case SSPublishContentStateFail:
//                mfwState = MFWShareResultStateFail;
//                break;
//            default:
//                return; // 不处理，直接返回
//                break;
//        }
//        
//        NSString* errorMsg = [error errorDescription];
//        if (result) {
//            result([self getMFWShareType:type],mfwState,errorMsg);
//        }
//        
//        if (self.disableDefaultShareResultTips == NO) {
//            if(state == SSResponseStateSuccess){
//                UIWindow *window =  [UIApplication sharedApplication].keyWindow;
//                [window mfwshare_showTip:@"分享成功~😊"];
//            }
//            
//            if(state == SSResponseStateFail){
//                UIWindow *window =  [UIApplication sharedApplication].keyWindow;
//                NSString *failMsg = [NSString stringWithFormat:@"分享失败~😢,错误代码是%d",[error errorCode]];
//                [window mfwshare_showTip:failMsg];
//                
//            }
//        }
//    }];
//}
//
//
//-(void)shareImageWithType:(MFWShareType)type
//                text:(NSString *)text
//               image:(UIImage *)image
//            imageUrl:(NSString *)imageUrl
//                 url:(NSString *)url
//               title:(NSString *)title
//              result:(void (^)(MFWShareType, MFWShareResultState, NSString *))result
//{
//    id<ISSContent> publishContent = [self shareSDKForImagePublishContent:text image:image imageUrl:imageUrl url:url title:title];
//    id<ISSAuthOptions> authOptions = [self shareSDKAuthOption];
//    id<ISSShareOptions> shareOptions = [self shareSDKShareOption];
//    id<ISSContainer> container = [ShareSDK container];
//    [container setIPhoneContainerWithViewController:nil];
//    
//    [ShareSDK showShareViewWithType:[self getShareSDKShareType:type] container:container content:publishContent statusBarTips:NO authOptions:authOptions shareOptions:shareOptions result:^(ShareType type, SSResponseState state, id<ISSPlatformShareInfo> statusInfo, id<ICMErrorInfo> error, BOOL end) {
//        // 开始分享这个事件不处理
//        if (!end) {
//            return;
//        }
//        
//        MFWShareResultState mfwState = MFWShareResultStateFail;
//        switch (state) {
//            case SSPublishContentStateSuccess:
//                mfwState = MFWShareResultStateSuccess;
//                break;
//            case SSPublishContentStateCancel:
//                mfwState = MFWShareResultStateCancel;
//                break;
//            case SSPublishContentStateFail:
//                mfwState = MFWShareResultStateFail;
//                break;
//            default:
//                return; // 不处理，直接返回
//                break;
//        }
//        
//        NSString* errorMsg = [error errorDescription];
//        if (result) {
//            result([self getMFWShareType:type],mfwState,errorMsg);
//        }
//        
//        if (self.disableDefaultShareResultTips == NO) {
//            if(state == SSResponseStateSuccess){
//                UIWindow *window =  [UIApplication sharedApplication].keyWindow;
//                [window mfwshare_showTip:@"分享成功~😊"];
//            }
//            
//            if(state == SSResponseStateFail){
//                UIWindow *window =  [UIApplication sharedApplication].keyWindow;
//                NSString *failMsg = [NSString stringWithFormat:@"分享失败~😢,错误代码是%d",[error errorCode]];
//                [window mfwshare_showTip:failMsg];
//                
//            }
//        }
//    }];
//    
//}
//
//
//
//
//-(id<ISSContent>)shareSDKPublishContent:(NSString*)text
//                                  image:(UIImage*)image
//                               imageUrl:(NSString*)imageUrl
//                                    url:(NSString*)url
//                                  title:(NSString*)title
//{
//    id<ISSCAttachment> attachment = nil;
//    if (imageUrl) {
//        attachment = [ShareSDK imageWithUrl:imageUrl];
//    }else if(image){
//        attachment = [ShareSDK pngImageWithImage:image];
//    }
//    
//    id<ISSContent> publishContent =  [ShareSDK content:text
//                                        defaultContent:text
//                                                 image:attachment
//                                                 title:title
//                                                   url:url
//                                           description:text
//                                             mediaType:SSPublishContentMediaTypeNews];
//    
//    
//    //    // 定制人人内容
//    //    [publishContent addRenRenUnitWithName:title
//    //                              description:@" "
//    //                                      url:url
//    //                                  message:INHERIT_VALUE
//    //                                    image:attachment
//    //                                  caption:INHERIT_VALUE];
//    
//    [publishContent addQQSpaceUnitWithTitle:title url:url site:nil fromUrl:nil comment:nil summary:text image:attachment type:[NSNumber numberWithInt:4] playUrl:nil nswb:[NSNumber numberWithInt:0]];
//    
//    return publishContent;
//}
//
//-(id<ISSContent>)shareSDKForImagePublishContent:(NSString*)text
//                                  image:(UIImage*)image
//                               imageUrl:(NSString*)imageUrl
//                                    url:(NSString*)url
//                                  title:(NSString*)title
//{
//    id<ISSCAttachment> attachment = nil;
//    if (imageUrl) {
//        attachment = [ShareSDK imageWithUrl:imageUrl];
//    }else if(image){
//        attachment = [ShareSDK pngImageWithImage:image];
//    }
//    if(title.length<1){
//        title = @"#来自蚂蜂窝旅游攻略的分享#";
//    }
//    if(url.length < 1){
//        url = @"http://www.mafengwo.com";
//    }
//    
//    id<ISSContent> publishContent =  [ShareSDK content:text
//                                        defaultContent:text
//                                                 image:attachment
//                                                 title:title
//                                                   url:url
//                                           description:text
//                                             mediaType:SSPublishContentMediaTypeImage];
//    
//    
//    
//    
//    [publishContent addQQSpaceUnitWithTitle:title url:url site:nil fromUrl:nil comment:nil summary:text image:attachment type:[NSNumber numberWithInt:4] playUrl:nil nswb:[NSNumber numberWithInt:0]];
//    
//    return publishContent;
//}
//
//
//
//-(id<ISSAuthOptions>)shareSDKAuthOption
//{
//    SSAuthViewStyle authViewType = SSAuthViewStyleFullScreenPopup;
//    if (([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] && [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)) {
//        authViewType = SSAuthViewStyleModal;
//    }
//    
//    return [ShareSDK authOptionsWithAutoAuth:YES
//                        allowCallback:YES
//                               scopes:nil
//                        powerByHidden:YES
//                       followAccounts:nil
//                        authViewStyle:authViewType
//                         viewDelegate:self
//              authManagerViewDelegate:nil];
//}
//
//-(id<ISSShareOptions>)shareSDKShareOption
//{
//    return [ShareSDK defaultShareOptionsWithTitle:NSLocalizedString(@"分享", nil)
//                           oneKeyShareList:nil
//                        cameraButtonHidden:YES
//                       mentionButtonHidden:YES
//                         topicButtonHidden:NO
//                            qqButtonHidden:YES
//                     wxSessionButtonHidden:YES
//                    wxTimelineButtonHidden:YES
//                      showKeyboardOnAppear:YES
//                         shareViewDelegate:self
//                       friendsViewDelegate:nil
//                     picViewerViewDelegate:nil];
//}
//
//
///**
// *	@brief	判断是否授权,微信、QQ、邮件、短信、打印、拷贝类型不支持授权功能。
// *
// *	@param 	type 	社会化平台类型
// *
// *	@return	YES 已授权； NO 未授权
// */
//- (BOOL)hasAuthorizedWithType:(MFWShareType)type
//{
//    return [ShareSDK hasAuthorizedWithType:[self getShareSDKShareType:type]];
//}
//
///**
// *	@brief	取消授权,微信、QQ、邮件、短信、打印、拷贝类型不支持授权功能。
// *
// *	@param 	type 	社会化平台类型
// */
//- (void)cancelAuthWithType:(MFWShareType)type
//{
//    return [ShareSDK cancelAuthWithType:[self getShareSDKShareType:type]];
//}
//
///**
// *	@brief	创建授权选项
// *
// *  @param  type    第三方平台类型
// *
// *	@return	授权选项
// */
//-(void)authWithType:(MFWShareType)type
//             result:(void(^)(MFWShareType type,MFWShareResultState state, NSString* errorMsg))result
//{
//    if (![[MFWShareManager sharedInstance] hasSet:type]) {
//        if (result) {
//            result(type,MFWShareResultStateFail,@"未配置第三方平台参数");
//            return;
//        }
//    }
//    
//    id<ISSAuthOptions> authOptions = [self shareSDKAuthOption];
//    
//    [ShareSDK authWithType:[self getShareSDKShareType:type]
//                   options:authOptions
//                    result:^(SSAuthState state, id<ICMErrorInfo> error){
//                        
//                        MFWShareResultState mfwState = MFWShareResultStateFail;
//                        NSString* errorMsg = nil;
//                        switch (state) {
//                            case SSAuthStateSuccess:
//                                mfwState = MFWShareResultStateSuccess;
//                                break;
//                            case SSAuthStateCancel:
//                                mfwState = MFWShareResultStateCancel;
//                                break;
//                            case SSAuthStateFail:
//                                mfwState = MFWShareResultStateFail;
//                                errorMsg = [error description];
//                                break;
//                            default:
//                                return; // 不处理，直接返回
//                                break;
//                        }
//                        
//                        if (result) {
//                            result(type,mfwState,errorMsg);
//                        }
//                        
//                    }];
//}
//
//
//
///**
// *	@brief	获取当前授权用户信息
// *
// *	@param 	shareType 	平台类型
// *  @param  result  获取用户信息返回事件
// */
//- (void)getUserInfoWithType:(MFWShareType)type
//                     result:(void(^)(MFWShareType type, id<IMFWShareUserInfo> userInfo, MFWShareResultState state, NSString* errorMsg))resultHandler
//{
//    id<ISSAuthOptions> authOptions = [self shareSDKAuthOption];
//    
//    
//    [ShareSDK getUserInfoWithType:[self getShareSDKShareType:type] authOptions:authOptions result:^(BOOL result, id<ISSPlatformUser> userInfo, id<ICMErrorInfo> error) {
//        MSWShareUserInfo* mfwUser = [[MSWShareUserInfo alloc] initWithShareSDKUserInfo:userInfo];
//        
//        MFWShareResultState mfwState = result?MFWShareResultStateSuccess:MFWShareResultStateFail;
//        NSString* errorMsg = [error errorDescription];
//        
//        if (resultHandler) {
//            resultHandler(type,mfwUser,mfwState,errorMsg);
//        }
//    }];
//}
//
/////**
//// *	@brief 获取授权信息（token）
//// *
//// *	@param	type	平台类型
//// *
//// *	@return	授权信息的原始字典
//// */
////- (NSDictionary*)getCredentialDictionary:(MFWShareType)type
////{
////    id<ISSPlatformCredential> credential = [ShareSDK getCredentialWithType:[self getShareSDKShareType:type]];
////    NSMutableDictionary* retDict = [NSMutableDictionary dictionaryWithCapacity:0];
////    if ([credential uid]) {
////        retDict[@"uid"] = [credential uid];
////    }
////    if([credential token]){
////        retDict[@"token"] = [credential token];
////    }
////    if([credential secret]){
////        retDict[@"secret"] = [credential secret];
////    }
////    if([credential expired]){
////        retDict[@"expired"] = [credential expired];
////    }
////    if([credential extInfo]){
////        retDict[@"extInfo"] = [credential extInfo];
////    }
////    
////    
////    
////    retDict[@"available"] = [NSNumber numberWithBool:[credential available]];
////    
////    return retDict;
////}
//
//- (id<IMFWShareCredentialInfo>)getCredentialInfo:(MFWShareType)type
//{
//    id<ISSPlatformCredential> credential = [ShareSDK getCredentialWithType:[self getShareSDKShareType:type]];
//    MFWShareCredentialInfo* info = [[MFWShareCredentialInfo alloc] initWithShareSDKCredential:credential];
//    return info;
//}
//
//#pragma mark ISSViewDelegate
//- (void)viewOnWillDisplay:(UIViewController *)viewController shareType:(ShareType)shareType
//{
//    if (self.blockViewContrllorWillShow) {
//        self.blockViewContrllorWillShow(viewController);
//    }
//}
//
//
//#pragma mark 关注
///**
// *	@brief	关注微信号（已废弃）
// *
// *	@param 	userData 	二维码数据
// */
////- (void)followWeixinUser:(NSString *)qrCode
////{
////    [ShareSDK followWeixinUser:qrCode];
////}
//
///**
// *	@brief  关注用户
// *
// *	@param	type	第三方平台
// *	@param	userName	用户名称
// */
//- (void)followUserWithType:(MFWShareType)type
//                  userName:(NSString*)userName
//                    result:(void(^)(MFWShareType type, BOOL success, NSString* errorMsg))resultHandler
//{
//    ShareType shareType = [self getShareSDKShareType:type];
//    [ShareSDK followUserWithType:shareType field:userName fieldType:SSUserFieldTypeName authOptions:nil viewDelegate:nil result:^(SSResponseState state, id<ISSPlatformUser> userInfo, id<ICMErrorInfo> error) {
//        if(state == SSResponseStateSuccess
//           || state == SSResponseStateFail
//           || state == SSResponseStateCancel)
//        {
//            if(resultHandler)
//            {
//                resultHandler(type,(state == SSResponseStateSuccess),[error errorDescription]);
//            }
//        }
//    }];
//}
//
//#pragma mark 平台资源
///**
// *	@brief	获取平台客户端名称
// *
// *	@param 	type 	分享类型
// *
// *	@return	名称
// */
//- (NSString *)getClientNameWithType:(MFWShareType)type
//{
//    return [ShareSDK getClientNameWithType:[self getShareSDKShareType:type]];
//}
//
///**
// *	@brief	获取平台客户端图标
// *
// *	@param 	type 	分享类型
// *
// *	@return	图标
// */
//- (UIImage *)getClientIconWithType:(MFWShareType)type
//{
//    return [ShareSDK getClientIconWithType:[self getShareSDKShareType:type]];
//}
//
//
//
////- (BOOL)isHideShareStatusBarTips{
////    if (self.disableVerCheckForReview) {
////        return NO;
////    }
////    
////    NSString *value = [MobClick getConfigParams:SHARE_ON_OFF];
////    if(value == nil || value.length<1){
////        return YES;
////    }else{
////        NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];
////        NSString* versionNum =[infoDict objectForKey:@"CFBundleShortVersionString"];
////        if([value isEqualToString:versionNum]){
////            return NO;
////        }else{
////            return YES;
////        }
////    }
////}
//
//@end
//
